﻿ using TradePublish.Exceptions;
using System;
using TradePublish.Dao;
namespace TradePublish.Service
{
    public class BrandInfoManager
    {
        private BrandInfoDao brandInfoDao = new BrandInfoDao();

        public void saveBrandInfo(string[] detial)
        {
            string str = "00";
            try
            {
                str = this.verifyHasGrasped(detial[0x11]);
            }
            catch (Exception exception)
            {
                throw new GraspTMException("读取商标验证是否已采集时发生异常信息：" + exception.Message);
            }
            this.brandInfoDao.saveBrandInfo(detial, !str.Substring(0, 1).Equals("0"), Convert.ToInt32(str.Substring(1)));
        }

        public void updateSylc(string regNo, string sylc)
        {
            this.brandInfoDao.updateSylc(regNo, sylc);
        }

        public string verifyHasGrasped(string regNo)
        {
            return this.brandInfoDao.verifyHasGrasped(regNo);
        }
    }
}

